/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pt.iasd.youthshelter.activity.nodes;

import java.util.List;
import org.openide.nodes.Children;
import org.openide.nodes.Node;
import pt.iasd.youthshelter.datamodel.Activity;

/**
 *
 * @author Rui
 */
public class ActivityChildren extends Children.Keys<Activity> {
    private List<Activity> activities;

    public ActivityChildren(List<Activity> activities) {
        this.activities = activities;
    }

    @Override
    protected Node[] createNodes(Activity key) {
        return new Node[] {new ActivityNode(key)};
    }

    @Override
    protected void addNotify() {
        if(activities != null) {
            setKeys(activities);
        }
    }
}
